package Homework3;

import java.util.Arrays;
import java.util.Scanner;

public class Homework3_5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] arr = new int[n];

        for (int i = 0; i < n; i++){
            arr[i] = input.nextInt();
        }

        Arrays.sort(arr);

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++){
                if (j != i) {
                    System.out.println(arr[i] + " " + arr[j]);
                }
            }
        }
    }
}
